/*
 * Copyright (C) 2009 ZXing authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.zxing.client.android;

import it.intecs.pisa.smarcos.base.SpeechManager;
import android.content.Context;

import com.google.zxing.ResultPoint;
import com.google.zxing.ResultPointCallback;

final class ViewfinderResultPointCallback implements ResultPointCallback {

	private final ViewfinderView viewfinderView;
	private SpeechManager speechManager;
	
	/*ViewfinderResultPointCallback(ViewfinderView viewfinderView) {
		this.viewfinderView = viewfinderView;
	}*/

	//INTECS CHANGE - BEGIN
	ViewfinderResultPointCallback(ViewfinderView viewfinderView, Context context) {
		this.viewfinderView = viewfinderView;
		speechManager = SpeechManager.getInstance(context);	
	}
	//INTECS CHANGE - END

	
	public void foundPossibleResultPoint(ResultPoint point) {
		viewfinderView.addPossibleResultPoint(point);
	}

	//INTECS CHANGE - BEGIN
	public void foundPossibleResultPoint(int direction) {
		if (direction != 0)
			speechManager.say(direction);	
	}
	//INTECS CHANGE - END
}
